function update_index() {
	alert("updating history data for index..");
	$.ajax({
		type: "POST",
	    url: "/admin",
	    data: {"type": "index"}
	})
	.done(function(total) {
		alert("Updated "+total+" rows for index.");
		//window.location.href="/";
	})
	.error(function(e) {
		alert("error in updating index..\nI guess it's a bug from cherrypy inside..");
	})
}
function update_stock() {
	alert("updating history data for stock..");
	$.ajax({
		type: "POST",
	    url: "/admin",
	    data: {"type": "stock"}
	})
	.done(function(total) {
		alert("Updated "+total+" rows for stock.");
		//window.location.href="/";
	})
}
function back() {
	window.location.href="/"
}

